package com.wkn.wknAdmin.service;

import com.wkn.wknAdmin.entity.Menu;
import com.wkn.wknAdmin.entity.User;
import com.wkn.wknAdmin.entity.dto.UserDto;
import com.wkn.wknAdmin.result.ResultVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Title:
 * @Description:
 * @Author: WKN
 * CreateDate: 2022/8/12 0:43
 */
public interface UserService {


    /**
     * 登录
     * @param userDto
     * @return
     */
    ResultVO login(UserDto userDto);



    /**
     *  查询单个用户
     * @param username
     * @return
     */
    User getOne(@Param("username")String username);
    User getById(@Param("id") String id);


    /**
     * 获取全部用户
     * @return
     */
    List<User> findAll();


    /**
     * 添加或更新用户
     * @param user
     * @return
     */
    ResultVO save(User user);


    /**
     * 删除用户
     * @param id
     * @return
     */
    int deleteById(@Param("id") Integer id);



    /**
     * 批量删除
     * @param ids
     * @return
     */
    int batchDelete(@RequestBody List<Integer> ids);






    /**
     *  分页查询用户
     * @param pageNum    当前页码
     * @param pageSize   每一页展示数据的条数
     * @return
     */
    List<User> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize,@Param("username") String username);


    /**
     * 获取表中记录总数
     * @return
     */
    int getTotalCount(@Param("username")String username);



}
